<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   主题：也问秩和检验两两比较的SAS编程  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/topic/6098/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466439876: Accept with keywords: (title(0.2):编程,主题,秩和,检验,论坛, topn(0.266666666667):软件应用,研究生,帖子,统计学,例数,会员,医学,用户名,主站,参数检验,计算,数据,校正,样本,变量,编程,检验,本例,密码,普通,感兴趣,语句,样本数,主题,程序,总计,数值,秩和,论坛,讨论区).-->
 </head>
 <body class="topic bbpress single single-topic postid-6098 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    主题：也问秩和检验两两比较的SAS编程
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-6098 topic type-topic status-publish hentry" id="post-6098">
        <header class="entry-header">
         <h1 class="entry-title">
          也问秩和检验两两比较的SAS编程
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div class="bbp-breadcrumb">
           <p>
            <a class="bbp-breadcrumb-home" href="http://cos.name/cn/">
             COS论坛 | 统计之都
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-root" href="http://cos.name/cn/forums/">
             讨论区
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/">
             软件应用
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/sas/">
             SAS
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <span class="bbp-breadcrumb-current">
             也问秩和检验两两比较的SAS编程
            </span>
           </p>
          </div>
          <div class="bbp-template-notice info">
           <p class="bbp-topic-description">
            该主题包含 13 条回复，4个帖子，最后由
            <a class="bbp-author-avatar" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
             <img src="http://sdn.geekzu.org/avatar/6e5ce2854f13b2ec52c553523d9fb952?s=14&amp;d=monsterid&amp;r=g"/>
            </a>
            <a class="bbp-author-name" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
             joan985
            </a>
            在
            <a href="http://cos.name/cn/topic/6098/#post-252346" title="回复：也问秩和检验两两比较的SAS编程">
             7 年, 11 月 之前
            </a>
            更新。
           </p>
          </div>
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 14 个帖子 - 1 到 14（总计 14 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <ul class="forums bbp-replies" id="topic-6098-replies">
           <li class="bbp-header">
            <div class="bbp-reply-author">
             作者
            </div>
            <!-- .bbp-reply-author -->
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-header -->
           <li class="bbp-body">
            <div class="bbp-reply-header" id="post-6098">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月27日 上午9:35
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-6098">
               1 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-6098 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-1 user-id-14231 topic-author post-6098 topic type-topic status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               非参数方法用的越来越多，医学数据很多都不是正态分布，经常会用到秩和检验来比较几组的中位数，牵涉到多组时两两比较是个问题，sas程序不知道如何完成，编制比较麻烦。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224009">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月27日 下午4:37
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224009">
               2 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224009 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-2 user-id-14231 topic-author post-224009 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               最近搞毕业论文，所以会问很多问题，等论文搞完了会好好参与讨论，也会把我在医学统计方面的资料和经验分享给大家。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224053">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月28日 上午7:03
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224053">
               3 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224053 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-3 user-id-10006 post-224053 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/10006/" rel="nofollow" title="查看zt2730的档案">
               <img src="http://sdn.geekzu.org/avatar/a0057e5aacf9a585fe8ae1a38b5b9bd0?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/10006/" rel="nofollow" title="查看zt2730的档案">
               zt2730
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我这是转帖：！！！！！也为他发愁过 后来在另外的论坛上找到了点答案！分享一下！
               <br/>
               对于多组间非参数检验的两两比较，SPSS和SAS中均没有现成的模块。 对分析变量进行编秩，然后采用方差分析对秩进行两两比较，感觉这是个不错的注意，但我没有看到相关参考书上的理论依据。
               <br/>
               本人现根据《医学统计学》（孙振球主编，供研究生用）提供的Nemenyi法，用SAS进行编程实现多个样本间的两两比较，希望大家试用，并改进。从下面实例的运行结果看，对秩的SNK法比较与Nemenyi法的结果是一致的。
               <br/>
               SAS程序如下：(dxy_zhaql)
              </p>
              <p>
               option formchar=" ———";
               <br/>
               /*本程序根据《医学统计学》（供研究生用）P133提供的Nemenyi法公式进行多个样本两两比较*/
               <br/>
               /*本例分组数为6，其它分组情况要做相应修改*/
               <br/>
               %let n=82;/*n为总例数*/
               <br/>
               %let g=6;/*g为组数*/
               <br/>
               data dt1;
               <br/>
               input x g@@;/*x为要分析的变量，g为分组变量*/
               <br/>
               output;
               <br/>
               cards;
               <br/>
               1.144414  1
               <br/>
               1.177112  4
               <br/>
               1.239130  4
               <br/>
               1.242507  1
               <br/>
               1.242507  1
               <br/>
               1.340599  1
               <br/>
               1.373297  1
               <br/>
               1.402174  5
               <br/>
               1.405995  4
               <br/>
               1.467391  4
               <br/>
               1.504087  5
               <br/>
               1.536785  5
               <br/>
               1.536785  6
               <br/>
               1.569482  1
               <br/>
               1.602180  6
               <br/>
               1.630435  4
               <br/>
               1.634877  6
               <br/>
               1.695652  1
               <br/>
               1.695652  6
               <br/>
               1.728261  1
               <br/>
               1.728261  4
               <br/>
               1.728261  6
               <br/>
               1.760870  4
               <br/>
               1.760870  6
               <br/>
               1.793478  1
               <br/>
               1.863760  4
               <br/>
               1.891304  1
               <br/>
               1.891304  4
               <br/>
               1.891304  5
               <br/>
               1.994550  6
               <br/>
               2.021739  1
               <br/>
               2.059946  4
               <br/>
               2.119565  1
               <br/>
               2.119565  6
               <br/>
               2.250000  6
               <br/>
               2.347826  3
               <br/>
               2.354223  1
               <br/>
               2.354223  2
               <br/>
               2.419619  4
               <br/>
               2.517711  6
               <br/>
               2.550409  5
               <br/>
               2.583106  4
               <br/>
               2.713896  3
               <br/>
               2.771739  2
               <br/>
               2.779292  5
               <br/>
               2.804348  3
               <br/>
               2.836957  5
               <br/>
               2.844687  4
               <br/>
               2.869565  3
               <br/>
               2.934783  1
               <br/>
               3.065217  3
               <br/>
               3.065217  5
               <br/>
               3.138965  3
               <br/>
               3.228261  5
               <br/>
               3.269755  2
               <br/>
               3.293478  6
               <br/>
               3.391304  4
               <br/>
               3.408719  3
               <br/>
               3.456522  3
               <br/>
               3.465940  3
               <br/>
               3.531335  6
               <br/>
               3.586957  3
               <br/>
               3.645777  3
               <br/>
               3.662125  3
               <br/>
               3.694823  2
               <br/>
               3.760218  2
               <br/>
               3.782609  2
               <br/>
               3.945652  2
               <br/>
               3.945652  2
               <br/>
               4.010870  2
               <br/>
               4.043478  3
               <br/>
               4.043478  5
               <br/>
               4.087193  5
               <br/>
               4.108696  5
               <br/>
               4.610354  6
               <br/>
               5.002725  5
               <br/>
               5.152174  2
               <br/>
               5.543478  2
               <br/>
               5.591281  5
               <br/>
               5.771739  6
               <br/>
               5.787466  3
               <br/>
               6.702997  2
               <br/>
               6.768392  2
               <br/>
               7.389646  2
               <br/>
               ;
               <br/>
               run;
               <br/>
               proc npar1way wilcoxon data=dt1;output out=dt9;var x;class g;run;/*非参数检验*/
               <br/>
               proc rank data=dt1 out=dt2;var x;ranks rx;run;/*编秩*/
               <br/>
               proc anova data=dt2;/*秩的SNK法比较*/
               <br/>
               class g;
               <br/>
               model rx=g;
               <br/>
               means g/snk;
               <br/>
               run;
               <br/>
               data dt3;/*保留具有相同秩的样本，以便计算校正变量C*/
               <br/>
               set dt2;
               <br/>
               keep i j x g rx;
               <br/>
               i+1;
               <br/>
               if i=rx then delete;
               <br/>
               j+1;
               <br/>
               run;
               <br/>
               proc sort data=dt3;by rx;run;
               <br/>
               proc univariate data=dt3 noprint;output out=dt4 n=n;
               <br/>
               var j;
               <br/>
               by rx;
               <br/>
               run;
               <br/>
               data dt5;
               <br/>
               set dt4;
               <br/>
               keep cj c n j;
               <br/>
               cj+(n**3-n)/(&amp;n**3-&amp;n);
               <br/>
               c=1-cj;
               <br/>
               run;
               <br/>
               proc univariate data=dt5 noprint;var c;output out=dt6 max=c;
               <br/>
               run;
               <br/>
               data _null_;
               <br/>
               set dt6;
               <br/>
               call symput('c',c);/*c为校正变量*/
               <br/>
               run;
               <br/>
               proc sort data=dt2 out=dt2sbg;by g;
               <br/>
               proc means data=dt2sbg noprint;var rx;by g; output out=rxbg mean=rxmean;/*计算各组均秩*/
               <br/>
               run;
               <br/>
               data dt7;/*给各组均秩、样本数赋值*/
               <br/>
               set rxbg;
               <br/>
               i+1;
               <br/>
               if i=1 then do;
               <br/>
               call symput('rx1',rxmean);call symput('n1',_freq_);end;
               <br/>
               if i=2 then do;
               <br/>
               call symput('rx2',rxmean);call symput('n2',_freq_);end;
               <br/>
               if i=3 then do;
               <br/>
               call symput('rx3',rxmean);call symput('n3',_freq_);end;
               <br/>
               if i=4 then do;
               <br/>
               call symput('rx4',rxmean);call symput('n4',_freq_);end;
               <br/>
               if i=5 then do;
               <br/>
               call symput('rx5',rxmean);call symput('n5',_freq_);end;
               <br/>
               if i=6 then do;
               <br/>
               call symput('rx6',rxmean);call symput('n6',_freq_);end;
               <br/>
               %put _user_;
               <br/>
               run;
               <br/>
               data dt8;/*计算组间比较卡方值和P值*/
               <br/>
               do g=1 to &amp;g*(&amp;g-1)/2;
               <br/>
               dif=&amp;g-1;
               <br/>
               if g=1 then do;
               <br/>
               com='g1-g2';meanscore1=&amp;rx1;meanscore2=&amp;rx2;
               <br/>
               chi=(&amp;rx1-&amp;rx2)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=2 then do;
               <br/>
               com='g1-g3';meanscore1=&amp;rx1;meanscore2=&amp;rx3;
               <br/>
               chi=(&amp;rx1-&amp;rx3)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=3 then do;
               <br/>
               com='g1-g4';meanscore1=&amp;rx1;meanscore2=&amp;rx4;
               <br/>
               chi=(&amp;rx1-&amp;rx4)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=4 then do;
               <br/>
               com='g1-g5';meanscore1=&amp;rx1;meanscore2=&amp;rx5;
               <br/>
               chi=(&amp;rx1-&amp;rx5)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=5 then do;
               <br/>
               com='g1-g6';meanscore1=&amp;rx1;meanscore2=&amp;rx6;
               <br/>
               chi=(&amp;rx1-&amp;rx6)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=6 then do;
               <br/>
               com='g2-g3';meanscore1=&amp;rx2;meanscore2=&amp;rx3;
               <br/>
               chi=(&amp;rx2-&amp;rx3)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=7 then do;
               <br/>
               com='g2-g4';meanscore1=&amp;rx2;meanscore2=&amp;rx4;
               <br/>
               chi=(&amp;rx2-&amp;rx4)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=8 then do;
               <br/>
               com='g2-g5';meanscore1=&amp;rx2;meanscore2=&amp;rx5;
               <br/>
               chi=(&amp;rx2-&amp;rx5)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=9 then do;
               <br/>
               com='g2-g5';meanscore1=&amp;rx2;meanscore2=&amp;rx5;
               <br/>
               chi=(&amp;rx2-&amp;rx6)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=10 then do;
               <br/>
               com='g3-g4';meanscore1=&amp;rx3;meanscore2=&amp;rx4;
               <br/>
               chi=(&amp;rx3-&amp;rx4)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=11 then do;
               <br/>
               com='g3-g5';meanscore1=&amp;rx3;meanscore2=&amp;rx5;
               <br/>
               chi=(&amp;rx3-&amp;rx5)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=12 then do;
               <br/>
               com='g3-g6';meanscore1=&amp;rx3;meanscore2=&amp;rx6;
               <br/>
               chi=(&amp;rx3-&amp;rx6)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=13 then do;
               <br/>
               com='g4-g5';meanscore1=&amp;rx4;meanscore2=&amp;rx5;
               <br/>
               chi=(&amp;rx4-&amp;rx5)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=14 then do;
               <br/>
               com='g4-g6';meanscore1=&amp;rx4;meanscore2=&amp;rx6;
               <br/>
               chi=(&amp;rx4-&amp;rx6)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               if g=15 then do;
               <br/>
               com='g5-g6';meanscore1=&amp;rx5;meanscore2=&amp;rx6;
               <br/>
               chi=(&amp;rx5-&amp;rx6)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;n2+1/&amp;n4)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;g-1);
               <br/>
               end;
               <br/>
               output;
               <br/>
               end;
               <br/>
               run;
               <br/>
               proc print;
               <br/>
               run;
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224056">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月28日 上午7:51
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224056">
               4 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224056 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-4 user-id-1083 post-224056 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               <img src="http://sdn.geekzu.org/avatar/fa524642d1b8259ae04f6130bdd1b752?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               huadli
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               谢谢
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224064">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月28日 上午9:06
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224064">
               5 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224064 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-5 user-id-1083 post-224064 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               <img src="http://sdn.geekzu.org/avatar/fa524642d1b8259ae04f6130bdd1b752?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               huadli
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               %macro nparcomparison(data=,            /*我们要分析的数据集        */
               <br/>
               n=,                                   /*样本数                    */
               <br/>
               group=,                           /*感兴趣的组别，数值型      */
               <br/>
               groupnum=,                    /*感兴趣的组的水平          */
               <br/>
               var=);                             /*感兴趣的变量              */
              </p>
              <p>
               proc rank data=&amp;data out=r_&amp;data;
               <br/>
               var &amp;var;
               <br/>
               ranks r&amp;var;
               <br/>
               run;
              </p>
              <p>
               data rr_&amp;data;/*保留具有相同秩的样本，以便计算校正变量C*/
               <br/>
               set r_&amp;data;
               <br/>
               keep i j x &amp;group r&amp;var;
               <br/>
               i+1;
               <br/>
               if i=r&amp;var then delete;
               <br/>
               j+1;
               <br/>
               run;
              </p>
              <p>
               proc sort data=rr_&amp;data;
               <br/>
               by r&amp;var;
               <br/>
               run;
              </p>
              <p>
               proc univariate data=rr_&amp;data noprint;
               <br/>
               var j;
               <br/>
               output out=rrr_&amp;data n=n;
               <br/>
               by r&amp;var;
               <br/>
               run;
              </p>
              <p>
               data rr_&amp;data;
               <br/>
               set rr_&amp;data;
               <br/>
               keep cj c n j;
               <br/>
               cj+(n**3-n)/(&amp;n**3-&amp;n);
               <br/>
               c=1-cj;
               <br/>
               run;
              </p>
              <p>
               proc univariate data=rr_&amp;data noprint;
               <br/>
               var c;
               <br/>
               output out=dt6 max=c;
               <br/>
               run;
              </p>
              <p>
               data _null_;
               <br/>
               set dt6;
               <br/>
               call symput('c',c);/*c为校正变量*/
               <br/>
               run;
              </p>
              <p>
               proc means data=r_&amp;data  nway noprint;
               <br/>
               class &amp;group;
               <br/>
               var r&amp;var;
               <br/>
               output out=rxbg mean=r&amp;var.mean;/*计算各组均秩*/
               <br/>
               run;
              </p>
              <p>
               data _null_;
               <br/>
               set rxbg;
              </p>
              <p>
               %do i=1 %to &amp;groupnum;
               <br/>
               if &amp;group=&amp;i then
               <br/>
               do;
               <br/>
               call symput("rx&amp;i",r&amp;var.mean);call symput("n&amp;i",_freq_);
               <br/>
               end;
               <br/>
               %end;
               <br/>
               run;
              </p>
              <p>
               data out;
               <br/>
               %do i=1 %to &amp;groupnum;
               <br/>
               %do j=%eval(&amp;i+1) %to &amp;groupnum;
               <br/>
               label="group&amp;i-group&amp;j";
               <br/>
               meanscore1=&amp;&amp;rx&amp;i;
               <br/>
               meanscore2=&amp;&amp;rx&amp;j;
               <br/>
               chi=(&amp;&amp;rx&amp;i-&amp;&amp;rx&amp;j)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;&amp;n&amp;i+1/&amp;&amp;n&amp;j)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;groupnum-1);
               <br/>
               output;
               <br/>
               %end;
               <br/>
               %end;
               <br/>
               run;
              </p>
              <p>
               title "Contrast";
              </p>
              <p>
               options missing=' ';
               <br/>
               proc print data=out label uniform noobs split='*';
               <br/>
               format meanscore1   10.2
               <br/>
               meanscore2   10.2
               <br/>
               chi          10.2
               <br/>
               p            pvalue7.4
               <br/>
               ;
               <br/>
               label
               <br/>
               label="Label"
               <br/>
               meanscore1="Group's mean score"
               <br/>
               meanscore2="Group's mean score"
               <br/>
               chi="Chi's statistics"
               <br/>
               p="P value";
              </p>
              <p>
               var label meanscore1 meanscore2 chi p;
               <br/>
               run;
               <br/>
               options missing='.';
              </p>
              <p>
               proc datasets library=work  nolist;
               <br/>
               delete r_&amp;data rr_&amp;data rrr_&amp;data dt6 rxbg;
               <br/>
               run;
               <br/>
               quit;
              </p>
              <p>
               %mend nparcomparison;
              </p>
              <p>
               %nparcomparison(data=dt1,group=g,groupnum=6,var=x);
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224066">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月28日 上午9:21
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224066">
               6 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224066 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-6 user-id-1083 post-224066 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               <img src="http://sdn.geekzu.org/avatar/fa524642d1b8259ae04f6130bdd1b752?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               huadli
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               chi=(&amp;&amp;rx&amp;i-&amp;&amp;rx&amp;j)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;&amp;n&amp;i+1/&amp;&amp;n&amp;j)*&amp;c);
              </p>
              <p>
               组不同时 1/&amp;&amp;n&amp;i+1/&amp;&amp;n&amp;j是不是要变化 ？？？
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224134">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月29日 上午4:58
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224134">
               7 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224134 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-7 user-id-14231 topic-author post-224134 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               多谢，试试先
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224162">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月29日 上午11:30
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224162">
               8 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224162 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-8 user-id-14231 topic-author post-224162 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               好像有点问题呀
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224163">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月29日 上午11:31
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224163">
               9 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224163 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-9 user-id-14231 topic-author post-224163 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               <img src="http://sdn.geekzu.org/avatar/8e992f119108ddb2f6238c88c569fa0d?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/14231/" rel="nofollow" title="查看jiangshq的档案">
               jiangshq
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               22: LINE and COLUMN cannot be determined.
               <br/>
               NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow recovery of the LINE and COLUMN
               <br/>
               where the error has occurred.
               <br/>
               ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
               <br/>
               a numeric constant, a datetime constant, a missing value, INPUT, PUT.
               <br/>
               22: LINE and COLUMN cannot be determined.
               <br/>
               NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL may allow recovery of the LINE and COLUMN
               <br/>
               where the error has occurred.
               <br/>
               ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
               <br/>
               a numeric constant, a datetime constant, a missing value, INPUT, PUT.
              </p>
              <p>
               NOTE: The SAS System stopped processing this step because of errors.
               <br/>
               WARNING: The data set WORK.RR_DT1 may be incomplete.  When this step was stopped there were 0
               <br/>
               observations and 4 variables.
               <br/>
               WARNING: Data set WORK.RR_DT1 was not replaced because this step was stopped.
               <br/>
               NOTE: DATA statement used (Total process time):
               <br/>
               real time           0.03 seconds
               <br/>
               cpu time            0.01 seconds
              </p>
              <p>
               ERROR: Variable C not found.
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224167">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月29日 下午12:43
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224167">
               10 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224167 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-10 user-id-1083 post-224167 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               <img src="http://sdn.geekzu.org/avatar/fa524642d1b8259ae04f6130bdd1b752?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               huadli
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               %nparcomparison(data=dt1,n=82,group=g,groupnum=6,var=x);
               <br/>
               这个 忘记改了
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-224168">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2007年4月29日 下午12:50
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-224168">
               11 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-224168 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-11 user-id-1083 post-224168 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               <img src="http://sdn.geekzu.org/avatar/fa524642d1b8259ae04f6130bdd1b752?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1083/" rel="nofollow" title="查看huadli的档案">
               huadli
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               %macro nparcomparison(data=,         /*我们要分析的数据集     */
               <br/>
               group=,                   /*感兴趣的组别，数值型     */
               <br/>
               groupnum=,             /*感兴趣的组的水平       */
               <br/>
               var=);                   /*感兴趣的变量         */
              </p>
              <p>
               data &amp;data;
               <br/>
               set &amp;data end=eof;
               <br/>
               t+1;
               <br/>
               if eof then
               <br/>
               call symput("n",t);
               <br/>
               run;
              </p>
              <p>
               proc rank data=&amp;data out=r_&amp;data;
               <br/>
               var &amp;var;
               <br/>
               ranks r&amp;var;
               <br/>
               run;
              </p>
              <p>
               data rr_&amp;data;/*保留具有相同秩的样本，以便计算校正变量C*/
               <br/>
               set r_&amp;data;
               <br/>
               keep i j &amp;var &amp;group r&amp;var;
               <br/>
               i+1;
               <br/>
               if i=r&amp;var then delete;
               <br/>
               j+1;
               <br/>
               run;
              </p>
              <p>
               proc sort data=rr_&amp;data;
               <br/>
               by r&amp;var;
               <br/>
               run;
              </p>
              <p>
               proc univariate data=rr_&amp;data noprint;
               <br/>
               var j;
               <br/>
               output out=rrr_&amp;data n=n;
               <br/>
               by r&amp;var;
               <br/>
               run;
              </p>
              <p>
               data rr_&amp;data;
               <br/>
               set rr_&amp;data;
               <br/>
               keep cj c n j;
               <br/>
               cj+(n**3-n)/(&amp;n**3-&amp;n);
               <br/>
               c=1-cj;
               <br/>
               run;
              </p>
              <p>
               proc univariate data=rr_&amp;data noprint;
               <br/>
               var c;
               <br/>
               output out=dt6 max=c;
               <br/>
               run;
              </p>
              <p>
               data _null_;
               <br/>
               set dt6;
               <br/>
               call symput('c',c);/*c为校正变量*/
               <br/>
               run;
              </p>
              <p>
               proc means data=r_&amp;data nway noprint;
               <br/>
               class &amp;group;
               <br/>
               var r&amp;var;
               <br/>
               output out=rxbg mean=r&amp;var.mean;/*计算各组均秩*/
               <br/>
               run;
              </p>
              <p>
               data _null_;
               <br/>
               set rxbg;
              </p>
              <p>
               %do i=1 %to &amp;groupnum;
               <br/>
               if &amp;group=&amp;i then
               <br/>
               do;
               <br/>
               call symput("rx&amp;i",r&amp;var.mean);call symput("n&amp;i",_freq_);
               <br/>
               end;
               <br/>
               %end;
               <br/>
               run;
              </p>
              <p>
               data out;
               <br/>
               %do i=1 %to &amp;groupnum;
               <br/>
               %do j=%eval(&amp;i+1) %to &amp;groupnum;
               <br/>
               label="group&amp;i-group&amp;j";
               <br/>
               meanscore1=&amp;&amp;rx&amp;i;
               <br/>
               meanscore2=&amp;&amp;rx&amp;j;
               <br/>
               chi=(&amp;&amp;rx&amp;i-&amp;&amp;rx&amp;j)**2/(((&amp;n*(&amp;n+1))/12)*(1/&amp;&amp;n&amp;i+1/&amp;&amp;n&amp;j)*&amp;c);
               <br/>
               p=1-probchi(chi,&amp;groupnum-1);
               <br/>
               output;
               <br/>
               %end;
               <br/>
               %end;
               <br/>
               run;
              </p>
              <p>
               title "Contrast";
              </p>
              <p>
               options missing=' ';
               <br/>
               proc print data=out label uniform noobs split='*';
               <br/>
               format meanscore1   10.2
               <br/>
               meanscore2   10.2
               <br/>
               chi       10.2
               <br/>
               p         pvalue7.4
               <br/>
               ;
               <br/>
               label
               <br/>
               label="Label"
               <br/>
               meanscore1="Group's mean score"
               <br/>
               meanscore2="Group's mean score"
               <br/>
               chi="Chi's statistics"
               <br/>
               p="P value";
              </p>
              <p>
               var label meanscore1 meanscore2 chi p;
               <br/>
               run;
               <br/>
               options missing='.';
              </p>
              <p>
               proc datasets library=work nolist;
               <br/>
               delete r_&amp;data rr_&amp;data rrr_&amp;data dt6 rxbg;
               <br/>
               run;
               <br/>
               quit;
              </p>
              <p>
               %mend nparcomparison;
              </p>
              <p>
               %nparcomparison(data=dt1,group=g,groupnum=6,var=x);
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-252310">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2008年7月9日 上午5:23
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-252310">
               12 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-252310 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-12 user-id-73278 post-252310 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               <img src="http://sdn.geekzu.org/avatar/6e5ce2854f13b2ec52c553523d9fb952?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               joan985
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               是不是就是做宏的程序呢？
               <br/>
               另外，个人见解，将BY语句改为CLASS语句，就省略掉SORT排序的程序了，简单迅速。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-252345">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2008年7月10日 上午2:54
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-252345">
               13 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-252345 -->
            <div class="odd bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-13 user-id-73278 post-252345 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               <img src="http://sdn.geekzu.org/avatar/6e5ce2854f13b2ec52c553523d9fb952?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               joan985
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我用过这个程序还不错
               <br/>
               proc npar1way data=sasuser.a1 wilcoxon;这边是直接用数据集，如果小数据可以使用input语句
              </p>
              <p>
               var x;                    x是变量
               <br/>
               class g;                  g是分组
               <br/>
               run;
              </p>
              <p>
               proc freq data=sasuser.a1;
               <br/>
               tables g*x/scores=rank cmh2;
               <br/>
               run;
              </p>
              <p>
               proc rank;
               <br/>
               var x;ranks rx;
               <br/>
               run;
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-252346">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2008年7月10日 上午3:00
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/6098/#post-252346">
               14 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-252346 -->
            <div class="even bbp-parent-forum-998 bbp-parent-topic-6098 bbp-reply-position-14 user-id-73278 post-252346 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               <img src="http://sdn.geekzu.org/avatar/6e5ce2854f13b2ec52c553523d9fb952?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/73278/" rel="nofollow" title="查看joan985的档案">
               joan985
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               上面的程序是连续性变量啊，补充一下
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
           </li>
           <!-- .bbp-body -->
           <li class="bbp-footer">
            <div class="bbp-reply-author">
             作者
            </div>
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-footer -->
          </ul>
          <!-- #topic-6098-replies -->
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 14 个帖子 - 1 到 14（总计 14 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <div class="bbp-no-reply" id="no-reply-6098">
           <div class="bbp-template-notice">
            <p>
             您必须先登录才能回复该主题。
            </p>
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <div class="comments-area" id="comments">
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>